package com.neusoft.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.neusoft.service.JieService;

@Controller
public class HomeController {
	@Autowired
	private JieService jieService;
	@RequestMapping("/")
	public ModelAndView index(){
		List<Map<String, Object>> listTopics =jieService.getAllTopics();
		System.out.println(listTopics);
		ModelAndView modelAndView =new ModelAndView();
		modelAndView.addObject("topics",listTopics);
		modelAndView.setViewName("index");
		return modelAndView;
	} 
	
}
